//
//  BYPerson.swift
//  tableViewCell-Test
//
//  Created by 胡忠诚 on 15/12/13.
//  Copyright © 2015年 biyu6. All rights reserved.
//

import UIKit

class BYPerson: NSObject {
    
    var name: String?
    var age: Int = 0//需要设置一个默认值
    
    //通过KVC,动态给属性赋值
    init(dict: [String: AnyObject]){
        super.init()
        
        setValuesForKeysWithDictionary(dict)

    }
    
    //重写description,方便调试
    override var description: String {
        
        let keys = ["name","age"]
        
        return "\(dictionaryWithValuesForKeys(keys))"
    }
    
}
